﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crosland.Automotriz.Core;

namespace Crosland.Automotriz.Data.Dao.Linq
{
    public class clsTd_MonedaDAO
    {
        private AutomotrizEntities ContextoDeObjs = new AutomotrizEntities();
        public IEnumerable<Object> lista() {

            IEnumerable<Object> list = new List<Object>();
            try
            {
                var q = from c in ContextoDeObjs.TD_MONEDA
                        select new { c.COD_MONEDA,c.DES_ABREV_MONEDA,c.DES_MONEDA,c.ID_MONEDA};
                list = q.ToList();
            }
            catch (Exception)
            {

                return null;
            }
            return list;
        
        }

        public List<TD_MONEDA> listaMonedas() 
        {
            try
            {
                var q = from c in ContextoDeObjs.TD_MONEDA
                        orderby c.DES_MONEDA
                        select c;
                return q.ToList();
            }
            catch (Exception)
            {
                return null;
            }
        }
    }
}
